# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=link-grammar
pkgver=5.12.3
pkgrel=2
pkgdesc="A Grammar Checking library"
arch=('loong64' 'x86_64')
url="https://www.abisource.com/projects/link-grammar/"
license=('LGPL')
depends=('hunspell' 'sqlite' 'libedit')
makedepends=('python' 'swig' 'apache-ant' 'java-environment=11')
options=('!makeflags')
source=(https://github.com/opencog/link-grammar/archive/refs/tags/${pkgname}-${pkgver}.tar.gz)
validpgpkeys=('6407453C98BECC19ADB03D82EB6AA534E0C0651C'
              '8305252160000B5E89843F5464A99A8201045933') # Linas Vepstas <linasvepstas@gmail.com>
sha256sums=('e0cd1b94cc9af20e5bd9a04604a714e11efe21ae5e453b639cdac050b6ac4150')

build() {
  cd ${pkgname}-${pkgver}

  ./configure --prefix=/usr

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd ${pkgname}-${pkgver}

  make DESTDIR="${pkgdir}" install
}
